package com.xcx.portal.controller;


import com.alibaba.dubbo.config.annotation.Reference;
import com.xcx.common.services.PetService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 宠物controller
 *
 * @author 唐邱勇
 */
@RestController
@RequestMapping(value = "/xcx/pet")
public class PetController {

    @Reference
    private PetService petService;

    /**
     * 用户登录
     *
     * @param reqStr
     * @return
     */
    @RequestMapping(value = "/userLogin", produces = {"application/json;chart=UTF-8"})
    @ResponseBody
    public String userLogin(@RequestBody String reqStr) {
        return petService.userLogin(reqStr);
    }

    /**
     * 保存用户信息
     *
     * @param reqStr
     * @return
     */
    @RequestMapping(value = "/saveUserInfo", produces = {"application/json;chart=UTF-8"})
    @ResponseBody
    public String saveUserInfo(@RequestBody String reqStr) {
        return petService.saveUserInfo(reqStr);
    }

    /**
     * 生成录音信息
     *
     * @param reqStr
     * @return
     */
    @RequestMapping(value = "/querySound", produces = {"application/json;chart=UTF-8"})
    @ResponseBody
    public String querySound(@RequestBody String reqStr) {
        return petService.querySound(reqStr);
    }


}
